import 'package:flutter/foundation.dart';

class Constant {

  static const String placeholderImg = 'https://img2.baidu.com/it/u=3043138582,4041394508&fm=253&fmt=auto&app=138&f=GIF?w=220&h=220';

  ///是否开启全局显示库位，业务逻辑的问题，本来要有仓库才会有库位，现在仓库不知道什么时候才会有，暂时通过此参数显示或者隐藏库位信息
  static const bool isShowSeat  = false;

  ///用于FlutterBugly异常上报框架的AppId
  static const String androidAppId = "dc57c27f69";

  ///用于FlutterBugly异常上报框架的AppId
  static const String iOSAppId = "???";

  ///正在运行的App
  static String runningApp = 'main';

  ///环境
  ///prod-生产环境  test-测试环境
  static String envStr = 'prod';

  ///是否发布版本
  static const bool isReleaseMode = kReleaseMode;

  ///主app名
  static const String app = 'main';

  ///module名
  static const String moduleLib = 'library_base';

  ///module名
  static const String moduleHome = 'module_home';

  ///module名
  static const String moduleCommon = 'module_common';

  ///module名
  static const String moduleSetUp = 'module_set_up';

  ///module名
  static const String moduleAdministrator = 'module_administrator';

  ///module名
  static const String moduleDispatcher = 'module_dispatcher';

  ///module名
  static const String moduleWms = 'module_wms';

  ///目前主app是否在运行
  static bool mainIsRun = runningApp == app;

  ///目前module是否作为一个app在运行
  static bool baseIsRun = runningApp == moduleLib;

  ///目前module是否作为一个app在运行
  static bool setUpIsRun = runningApp == moduleSetUp;

  ///目前module是否作为一个app在运行
  static bool commonIsRun = runningApp == moduleCommon;

  ///目前module是否作为一个app在运行
  static bool administratorIsRun = runningApp == moduleAdministrator;

  ///目前module是否作为一个app在运行
  static bool dispatcherIsRun = runningApp == moduleDispatcher;

  ///目前module是否作为一个app在运行
  static bool wmsIsRun = runningApp == moduleWms;

  ///订单管理员包名
  static String? packAdmin() {
    return Constant.administratorIsRun ? null : moduleAdministrator;
  }

  static String? packLib() {
    return Constant.baseIsRun ? null : moduleLib;
  }

  static String? packCommon() {
    return Constant.commonIsRun ? null : moduleCommon;
  }

  static String? packSetUp() {
    return Constant.setUpIsRun ? null : moduleSetUp;
  }

  static String? packDispatcher() {
    return Constant.dispatcherIsRun ? null : moduleDispatcher;
  }

  static String? packWms() {
    return Constant.wmsIsRun ? null : moduleWms;
  }

}
